import React, {useState, useReducer} from 'react';
import reducer from "./reducer";
function Home(props) {
    const [state, dispatch] = useReducer(reducer, 0)
    return (
        <div>
            <h2>Home的当前计数: {state}</h2>
            <button onClick={event => dispatch({type: "increment"})}>+1</button>
            <button onClick={event => dispatch({type: "decrement"})}>-1</button>
        </div>
    );
}

export default Home;